package com.qin.malldiscount.controller;

import com.qin.mall.common.api.CommonResult;
import com.qin.malldiscount.domain.CmsPrefrenceArea;
import com.qin.malldiscount.service.CmsPrefrenceAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品优选管理Controller
 * @author Leisure
 * create 2022 2022/11/22 15:29
 **/
@RestController
@RequestMapping("/productPrefrenceArea")
public class CmsPrefrenceAreaController {

    @Autowired
    private CmsPrefrenceAreaService prefrenceAreaService;

    /**
     * 获取所有商品优选
     * @return
     */
    @GetMapping("/listAll")
    @ResponseBody
    public CommonResult<List<CmsPrefrenceArea>> listAll() {
        List<CmsPrefrenceArea> prefrenceAreaList = prefrenceAreaService.listAll();
        return CommonResult.success(prefrenceAreaList);
    }
}
